﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
    [DataContract, Table("IcmDispenseHistory")]
    public class DispenseHistory
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "DispenseHisId", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public int DispenseHisId { get; set; }


        [DataMember, ForeignKey("RequestParcelDtl")]
        public int? ReqDtlId { get; set; }

        [ForeignKey("MasResourceItem")]
        [DataMember, Display(Name = "ResItemId", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public int? ResItemId { get; set; }

        [StringLength(50)]
        [DataMember, Display(Name = "LotNo", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public string LotNo { get; set; }

        [ForeignKey("Warehouse")]
        [DataMember, Display(Name = "WhId", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public int? WhId { get; set; }

        [DataMember, Display(Name = "Quantity", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public int? Quantity { get; set; }

        [DisplayFormat(DataFormatString = "{0:N4}")]
        [DataMember, Display(Name = "Price", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public decimal? Price { get; set; }

        [StringLength(50)]
        [DataMember, Display(Name = "RefNo", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public string RefNo { get; set; }

        [StringLength(2)]
        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [ForeignKey("Dispense")]
        [DataMember, Display(Name = "DispenseId", ResourceType = typeof (Resources.DispenseHistoryResource))]
        public int DispenseId { get; set; }

        [DataMember]
        public virtual MasResourceItem MasResourceItem { get; set; }

        [DataMember]
        public virtual Warehouse Warehouse { get; set; }

        [DataMember]
        public virtual Dispense Dispense { get; set; }

        [DataMember]
        public virtual RequestParcelDtl RequestParcelDtl { get; set; }
    }
}